package ioperation;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class AddOperation implements IOperation{
    @Override
    public void word(BookList bookList) {
        System.out.println("请输入要添加的书籍名字");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.println("请输入要添加的书籍的作者");
        String author = scanner.nextLine();
        System.out.println("请输入要添加的书籍的类型");
        String type = scanner.nextLine();
        System.out.println("请输入要添加的书籍的价格");
        double price = scanner.nextDouble();
        Book book = new Book();
        book.setBook(name,author,type,price);
        bookList.AddBook(book);
        bookList.setUseSize(bookList.getUseSize()+1);
    }
}
